using System.Collections.Generic;
using System.Text.Json.Serialization;
using JlPay.Sdk.Models;
using JlPay.Sdk.Services;

namespace JlPay.Sdk.Models.Openmerch.Change
{
    /// <summary>
    /// 固定提现修改请求
    /// </summary>
    public class FixedWithdrawModifyRequest : OrgBaseRequest, IRequestMapper
    {
        /// <summary>
        /// API URL
        /// </summary>
        public const string API_URL = "/open/merch/access/fixed-withdraw/modify";

        /// <summary>
        /// 申请单id
        /// </summary>
        [JsonPropertyName("apply_id")]
        public string ApplyId { get; set; } = string.Empty;

        /// <summary>
        /// 设置方式，0-取消1-设置
        /// </summary>
        [JsonPropertyName("operate_type")]
        public string OperateType { get; set; } = string.Empty;

        /// <summary>
        /// 定点清算时间列表
        /// </summary>
        [JsonPropertyName("withdraw_time_list")]
        public List<string> WithdrawTimeList { get; set; } = new List<string>();

        /// <summary>
        /// 构造函数
        /// </summary>
        public FixedWithdrawModifyRequest()
        {
        }

        /// <summary>
        /// 转换为字典
        /// </summary>
        /// <returns>字典对象</returns>
        public Dictionary<string, object> ToMap()
        {
            var map = new Dictionary<string, object>();

            // 添加基础字段
            if (!string.IsNullOrEmpty(OrgNo))
                map["org_no"] = OrgNo;
            if (!string.IsNullOrEmpty(MerchNo))
                map["merch_no"] = MerchNo;
            if (!string.IsNullOrEmpty(ApplyId))
                map["apply_id"] = ApplyId;
            if (!string.IsNullOrEmpty(OperateType))
                map["operate_type"] = OperateType;
            if (WithdrawTimeList != null && WithdrawTimeList.Count > 0)
                map["withdraw_time_list"] = WithdrawTimeList;

            return map;
        }
    }
} 